import * as types from '../../constant/mutations_type'
import axios from '../../util/axios.js'
import homeState from '../state/homeState'
import qs from 'qs'


// 异步操作

// 在这里可以去随意去异步操作（可以自定义为三种状态获取数据成功，失败，超时）



export default {
    
  // [types.SEL_USERINFO]({ commit },data){                          //传进来的参数
  //   const dataErr = homeState
  //   let param = qs.stringify({ 'phone': data })
  //   axios('post',"tree/user/" ,types.SEL_USERINFO,commit, param, dataErr)
  // },
  // [types.SEL_USER_PRIZE]({ commit },data){
  //   const dataErr = homeState
  //   let param = qs.stringify({ 'phone': data })
  //   axios('post',"tree/user/prize" ,types.SEL_USER_PRIZE,commit, param, dataErr)
  // },
  // [types.SEL_USER_PLANT]({commit},data){
  //   const dataErr = {
  //     plant_record:[]
  //   }
  //   let param = qs.stringify({ 'userId': data.userId,'page': data.page})
  //   axios('post','plant/userId/', types.SEL_USER_PLANT, commit, param,dataErr)
  // },
  [types.SEL_RULE]({ commit },data){
    const dataErr = {
      rule:[{id:'1',title:'',ruleBodies:[{id:'1-1',titleId:'1',body:''}]}]
    }
    axios('get','rule/title', types.SEL_RULE, commit, {},dataErr)
  },
}
